# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>

pkgname=libglib-testing
pkgver=0.1.0
pkgrel=1
pkgdesc="Test harnesses and mock classes for GLib"
url="https://gitlab.gnome.org/pwithnall/libglib-testing"
license=(LGPL2.1)
arch=(x86_64)
depends=(glib2 dbus)
makedepends=(git meson gtk-doc)
_commit=c761c9fd784bcaca03091af1280e53c0cad39dbc  # tags/0.1.0^0
source=("git+https://gitlab.gnome.org/pwithnall/libglib-testing.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  arch-meson $pkgname build
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  depends+=(libg{lib,object,io}-2.0.so)
  provides+=(libglib-testing-${pkgver%%.*}.so)

  DESTDIR="$pkgdir" meson install -C build
}
